/*
package com.zyq.validation.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebConfig  extends WebMvcConfigurerAdapter implements WebMvcConfigurer {
    public void addResourceHandlers(ResourceHandlerRegistry registry) {//静态资源设置和extends WebMvcConfigurerAdapter
        registry.addResourceHandler("/**").addResourceLocations("/","classpath:static","classpath:static/*");
        super.addResourceHandlers(registry);
    }*/
/*    public void addCorsMappings(CorsRegistry registry) {//cors
        registry.addMapping("/**")  //匹配所有请求
//                .allowedOrigins("*")  //放行的Origin//注：有时allowCredentials()设置为true时，allowedOrigins不能设置为*
//                .allowedOrigins("localhost:8080","localhost:8080/reg2")  //放行的Origin
                .allowedOriginPatterns("localhost:*","localhost:8080/*")
                //allowedOriginPatterns是spring5.3出现的方法，作用和allowedOrigins相同，

                .allowedMethods("*")//放行的方法
                .allowedHeaders("*")// 允许的请求头;
                .allowCredentials(true)// 是否允许证书（cookies）
                .maxAge(3600);
    }
}*/



